<template>
  <div>
        <router-link list to="" v-for="(item ,i) in info" :key="i">
        <div left>
          <!-- <img src="/static/img/person.jpg" alt=""> -->
          <div>
            <span>{{item.title}}</span>
            <p>
              {{item.content}}
            </p>
          </div>
        </div>
        <div right>
          <!-- <span>已阅读</span> -->
          <!-- <van-icon icon name="arrow" /> -->
        </div>
    </router-link>
  </div>
</template>
<script>
export default {
  data(){
    return{
      info:[]
    }
  },
  created(){
this.init()
  },
  methods:{
 init(){
    this.axios.get('/api/user/message',{params:{uid:JSON.parse(sessionStorage.getItem('user')).uid}}).then(res=>{
      if(res.data.err_code ==0){
        this.info = res.data.data;
      }else{
        console.log(res)
      }
    }).catch(e=>{
      console.log(e)
    })
  }
  },

}
</script>

<style lang="less" scoped>
[list]{
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  [left]{
    span{
      font-size: 14px;
      color: #333;
    }
    p{
      width: 66vw;
      font-size: 12px;
      color: #666;
    }
    display: flex;
      img{
        margin-right: 10px;
        height: 30px;
        width: 30px;
        border-radius: 50%;
      }
  }
  [right]{
    display: flex;
    color: #a6a6a6;
    font-size: 14px;
    [icon]{
      padding-top: 2px;
    }
  }
}
</style>

